<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../print.css" type="text/css" media="print">
<meta content="TaskGroup,com.developmentarc.core.datastructures.tasks.TaskGroup,GROUP_NOT_QUEUED,currentPhase,processedQueue,taskQueue,hasTask,isBlocker,phase,priority,ready,selfOverride,taskOverrides,tasks,type,uid,addTask,applyOverrides,cancel,getTaskIndex,handleTaskEvent,ignore,inQueue,inWaitingForReady,next,pause,removeAllTasks,removeTask,start" name="keywords">
<title>com.developmentarc.core.datastructures.tasks.TaskGroup</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'TaskGroup - DevelopmentArc Core API Documentation';
				var baseRef = '../../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">DevelopmentArc Core API</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../index-list.html')" href="../../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../../index.html?com/developmentarc/framework/datastructures/tasks/TaskGroup.html&amp;com/developmentarc/framework/datastructures/tasks/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;TaskGroup</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class TaskGroup"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.developmentarc.core.datastructures.tasks</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class TaskGroup</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">TaskGroup <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implements</td><td><a href="../../controllers/interfaces/ITaskGroup.html">ITaskGroup</a></td>
</tr>
</table>
<p></p>
  The TaskGroup is a data structure that allows a set of tasks
  to be grouped together as a set.  The TaskGroup can then be
  added to the TaskController and all of the grouped task will
  be exectued first before the next task in the controller is
  processed.
  
  <p>When an override is provided to the task controller, the
  task group acts as a parent type and the task group will
  remove all tasks if the provided override matches the group
  type.  The individual type of the task is ignored in this
  case.</p>
  
  <p>Tasks added to the group can override the same was as if they were
  added directly to the TaskController. Upon adding a task, the TaskGroup
  will evaluate the tasks overrides and the tasks selfOverrding boolean 
  and will take appropriate action.  The functionality is similar to the
  TaskController's override mechinism.
  </p>
  
  <p>TaskGroups can NOT be added to other TaskGroups at this time. A generic error will
  be thrown if this occurs</p>
  
  <p>Note: Once a TaskGroup has been added to the TaskController and queued, 
  the TaskGroup will no longer accept additional Task and will throw a generic error.
  </p>
  
  <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../../controllers/TaskController.html" target="">com.developmentarc.core.controllers.TaskController</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#hasTask">hasTask</a> : Boolean<div class="summaryTableDescription">[read-only]
   Determines if TaskGroup contains tasks or not.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#isBlocker">isBlocker</a> : Boolean<div class="summaryTableDescription">[read-only]
   Determines if the TaskGroup blocks all other items
   in the TaskController.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#phase">phase</a> : String<div class="summaryTableDescription">[read-only]
   Returns the current phase of the TaskGroup, such as started, etc.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#priority">priority</a> : uint<div class="summaryTableDescription">[read-only]
   The priority value of the TaskGroup.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#ready">ready</a> : Boolean<div class="summaryTableDescription">[read-only]
   TaskGroups are always ready and will return true
   </div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#selfOverride">selfOverride</a> : Boolean<div class="summaryTableDescription">
   Defines whether the group is self-overriding or not.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#taskOverrides">taskOverrides</a> : Array<div class="summaryTableDescription">
   An array of types of tasks / task groups that this
   task group should override in the TaskController.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#tasks">tasks</a> : Array<div class="summaryTableDescription">
   Returns all tasks still in queue or that have been proccessed
   </div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#type">type</a> : String<div class="summaryTableDescription">[read-only]
   The current type of TaskGroup.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#uid">uid</a> : Object<div class="summaryTableDescription">[read-only]
   Id of the group instance.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
</table>
</div>
<a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#currentPhase">currentPhase</a> : String = "GROUP_NOT_QUEUED"<div class="summaryTableDescription">
   The current phase of the group.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#processedQueue">processedQueue</a> : <a href="../utils/PriorityQueue.html">PriorityQueue</a>
<div class="summaryTableDescription">
   The tasks that have been started, cancelled, ignored or errored out.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#taskQueue">taskQueue</a> : <a href="../utils/PriorityQueue.html">PriorityQueue</a>
<div class="summaryTableDescription">
   The current tasks that have been added to the Group but have not
   been started() yet.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#TaskGroup()">TaskGroup</a>(type:String, priority:int = 5, uid:Object = null, selfOverride:Boolean = false, blocking:Boolean = false)</div>
<div class="summaryTableDescription">
   Constructor.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addTask()">addTask</a>(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):void</div>
<div class="summaryTableDescription">
   <p>Adds a single task to the task group.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#cancel()">cancel</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to canel and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getTaskIndex()">getTaskIndex</a>(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):int</div>
<div class="summaryTableDescription">
   Returns the index of a task in the taskQueue.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#ignore()">ignore</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to ignore and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#inQueue()">inQueue</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to queued and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#inWaitingForReady()">inWaitingForReady</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to wait for ready and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#next()">next</a>():<a href="../../controllers/interfaces/ITask.html">ITask</a>
</div>
<div class="summaryTableDescription">
   Returns the next task in the group with the highest
   priority task first.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#pause()">pause</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to pause and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAllTasks()">removeAllTasks</a>():void</div>
<div class="summaryTableDescription">
   Removes all tasks from the group.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeTask()">removeTask</a>(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):void</div>
<div class="summaryTableDescription">
   Removes all instances of a specific task from the group.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#start()">start</a>():void</div>
<div class="summaryTableDescription">
   Method is used to change groups phase to start and dispath event.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#applyOverrides()">applyOverrides</a>(newTask:<a href="../../controllers/interfaces/ITask.html">ITask</a>):Boolean</div>
<div class="summaryTableDescription">
   <p>
   Used to find and remove any tasks in the current group
   queue that are overriden by a new task that has been
   added to the group.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#handleTaskEvent()">handleTaskEvent</a>(event:<a href="../../controllers/events/TaskEvent.html">TaskEvent</a>):void</div>
<div class="summaryTableDescription">
   Method handles group tasks that have been completed, cancel or errored.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#GROUP_NOT_QUEUED">GROUP_NOT_QUEUED</a> : String = "GROUP_NOT_QUEUED"<div class="summaryTableDescription">[static]
   The default phase value of a group when it is first constructed
   but not added to the TaskController.</div>
</td><td class="summaryTableOwnerCol">TaskGroup</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="currentPhase"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">currentPhase</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>protected var currentPhase:String = "GROUP_NOT_QUEUED"</code><p>
   The current phase of the group. 
   </p></div>
<a name="hasTask"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hasTask</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>hasTask:Boolean</code>&nbsp;&nbsp;[read-only]<p>
   Determines if TaskGroup contains tasks or not.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get hasTask():Boolean</code>
<br>
</div>
<a name="isBlocker"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isBlocker</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>isBlocker:Boolean</code>&nbsp;&nbsp;[read-only]<p>
   Determines if the TaskGroup blocks all other items
   in the TaskController.  If the TaskGroup is set as
   a blocking task, the controller will load no more
   items from the queue until this group is complete,
   cancelled or errors. The default is false.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get isBlocker():Boolean</code>
<br>
</div>
<a name="phase"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">phase</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>phase:String</code>&nbsp;&nbsp;[read-only]<p>
   Returns the current phase of the TaskGroup, such as started, etc. 
   
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get phase():String</code>
<br>
</div>
<a name="priority"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">priority</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>priority:uint</code>&nbsp;&nbsp;[read-only]<p>
   The priority value of the TaskGroup.  0 is the highest
   priority and uint.MAX_VALUE is the lowest priority.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get priority():uint</code>
<br>
</div>
<a name="processedQueue"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">processedQueue</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var processedQueue:<a href="../utils/PriorityQueue.html">PriorityQueue</a></code><p>
   The tasks that have been started, cancelled, ignored or errored out. 
   </p></div>
<a name="ready"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ready</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>ready:Boolean</code>&nbsp;&nbsp;[read-only]<p>
   TaskGroups are always ready and will return true
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get ready():Boolean</code>
<br>
</div>
<a name="selfOverride"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">selfOverride</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>selfOverride:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   Defines whether the group is self-overriding or not. When a group
   is self-overriding then when the group is added to the TaskController
   the TaskController will determine if the group already exists in the queue
   and if so then it will be removed from the queue.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get selfOverride():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set selfOverride(value:Boolean):void</code>
<br>
</div>
<a name="taskOverrides"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">taskOverrides</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>taskOverrides:Array</code>&nbsp;&nbsp;[read-write]<p>
   An array of types of tasks / task groups that this
   task group should override in the TaskController. When
   a task group is added to the controller, the controller
   uses the taskOverrides list to determine what tasks or
   other groups should be removed from the current queue.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get taskOverrides():Array</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set taskOverrides(value:Array):void</code>
<br>
</div>
<a name="taskQueue"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">taskQueue</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var taskQueue:<a href="../utils/PriorityQueue.html">PriorityQueue</a></code><p>
   The current tasks that have been added to the Group but have not
   been started() yet. 
   </p></div>
<a name="tasks"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">tasks</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>tasks:Array</code>&nbsp;&nbsp;[read-write]<p>
   Returns all tasks still in queue or that have been proccessed
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get tasks():Array</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set tasks(value:Array):void</code>
<br>
</div>
<a name="type"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">type</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>type:String</code>&nbsp;&nbsp;[read-only]<p>
   The current type of TaskGroup. The type defines how task
   overrides are applied when the group is in the queue.  
   If a task or task group overrides the matching type of 
   the group, the entire group is removed from the queue.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get type():String</code>
<br>
</div>
<a name="uid"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">uid</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>uid:Object</code>&nbsp;&nbsp;[read-only]<p>
   Id of the group instance. Used in applying self overrides.
   
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get uid():Object</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="TaskGroup()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TaskGroup</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function TaskGroup(type:String, priority:int = 5, uid:Object = null, selfOverride:Boolean = false, blocking:Boolean = false)</code><p>
   Constructor.  Sets the groups type and priority.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; The type of Task
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">priority</span>:int</code> (default = <code>5</code>)<code></code> &mdash; The priority of the TaskGroup inside of the TaskController. Default is 5. Lower the number the higher the priority.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">uid</span>:Object</code> (default = <code>null</code>)<code></code> &mdash; The id set to this group. uid can be of any type. Default is null
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">selfOverride</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Boolean indicating if the TaskGroup can override other TaskGroups of the same type with same uid. Default false
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">blocking</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addTask()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addTask</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addTask(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):void</code><p>
   </p><p>Adds a single task to the task group.  The added
   task is stored by its priority within the task
   group.</p>
   
   <p>A group can NOT be added to another group. Error will be thrown.</p>
   
   <p>Tasks can only be added if the group is not already in the queue. Error will be thrown.</p>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">task</span>:<a href="../../controllers/interfaces/ITask.html">ITask</a></code> &mdash; New task to be added to group.
   
   </td>
</tr>
</table>
</div>
<a name="applyOverrides()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">applyOverrides</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function applyOverrides(newTask:<a href="../../controllers/interfaces/ITask.html">ITask</a>):Boolean</code><p>
   </p><p>
   Used to find and remove any tasks in the current group
   queue that are overriden by a new task that has been
   added to the group.
   </p>
   <p>
   If the new task is selfOverriding two scenarios will play out.
   <ul>
    <li>If new task has same type as a task in the queue but with a differnt uid, the existing task removed and canceled. The new task is then added.</li>
    <li>If new task has same type and the same uid as one in the queue, the new task is ignored and not added to the queue</li>
   </ul>
   </p>
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">newTask</span>:<a href="../../controllers/interfaces/ITask.html">ITask</a></code> &mdash; New Task to be added to queue
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Boolean True if newTasks overrides were processed,otherwise false
   </td>
</tr>
</table>
</div>
<a name="cancel()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">cancel</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function cancel():void</code><p>
   Method is used to change groups phase to canel and dispath event.
   The phase is first changed and then all tasks in the group are canceled before
   cancel event is dispatched (TestEvent.TASK_CANCEL).
   
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="getTaskIndex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getTaskIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getTaskIndex(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):int</code><p>
   Returns the index of a task in the taskQueue. Tasks
   that have been proccessed will not be found. Check 
   the phase of a task if you are sure a task is part of the group.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">task</span>:<a href="../../controllers/interfaces/ITask.html">ITask</a></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; 0 or greater if task is found, otherwise -1
   </td>
</tr>
</table>
</div>
<a name="handleTaskEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">handleTaskEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function handleTaskEvent(event:<a href="../../controllers/events/TaskEvent.html">TaskEvent</a>):void</code><p>
   Method handles group tasks that have been completed, cancel or errored.
   If the no more tasks are in queue, a complete event is dispatched.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:<a href="../../controllers/events/TaskEvent.html">TaskEvent</a></code></td>
</tr>
</table>
</div>
<a name="ignore()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ignore</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function ignore():void</code><p>
   Method is used to change groups phase to ignore and dispath event.
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="inQueue()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">inQueue</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function inQueue():void</code><p>
   Method is used to change groups phase to queued and dispath event.
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="inWaitingForReady()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">inWaitingForReady</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function inWaitingForReady():void</code><p>
   Method is used to change groups phase to wait for ready and dispath event.
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="next()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">next</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function next():<a href="../../controllers/interfaces/ITask.html">ITask</a></code><p>
   Returns the next task in the group with the highest
   priority task first.  This method removes the task
   from the task queue and addes to a proccessed queue.
    
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../../controllers/interfaces/ITask.html">ITask</a></code> &mdash; 
                        The next task in the group.
   
   
                        
                     </td>
</tr>
</table>
</div>
<a name="pause()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">pause</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function pause():void</code><p>
   Method is used to change groups phase to pause and dispath event.
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="removeAllTasks()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAllTasks</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeAllTasks():void</code><p>
   Removes all tasks from the group. When removed 
   the task's cancel() method is called on all unproccessed 
   tasks to allow listeners the ability to handle the removal.
   All proccessed tasks will simply be removed from the group.
   No further action is taken.
   
   </p></div>
<a name="removeTask()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeTask</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeTask(task:<a href="../../controllers/interfaces/ITask.html">ITask</a>):void</code><p>
   Removes all instances of a specific task from the group.
   When removed the task's cancel() method is called to
   allow listeners the ability to handle the removal.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">task</span>:<a href="../../controllers/interfaces/ITask.html">ITask</a></code> &mdash; The task to remove.
   
   </td>
</tr>
</table>
</div>
<a name="start()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">start</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function start():void</code><p>
   Method is used to change groups phase to start and dispath event.
   Method should NOT be called by anyone but the TaskController.
   </p></div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="GROUP_NOT_QUEUED"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">GROUP_NOT_QUEUED</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const GROUP_NOT_QUEUED:String = "GROUP_NOT_QUEUED"</code><p>
   The default phase value of a group when it is first constructed
   but not added to the TaskController. 
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
